Skip to content

Allow advanced search to return archived questions #6631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smithellis
Copy link
Contributor

We do a test to see if we are using simple or regular/advanced search. If we determine we are using simple search, we won't show archived questions. If we are using advanced search, we will return archived questions.

@smithellis smithellis requested a review from Copilot April 15, 2025 20:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates search filtering behavior to allow advanced search to return archived questions by conditionally applying archived filters based on the search mode (simple vs. advanced).

  • Added a new parameter, is_simple_search, to the get_filter methods in search and base classes.
  • Updated filter logic to conditionally exclude archived questions only on simple search.
  • Propagated the search mode flag down to child filters for consistent filtering behavior.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
kitsune/search/search.py Updated get_filter signatures and filtering logic to handle archived status
kitsune/search/base.py Updated abstract method signature and usage of get_filter with search mode

Comment on lines +347 to +349
def get_filter(self, is_simple_search: bool):
"""Placeholder for subclasses, should be implemented there."""
raise NotImplementedError
Copy link
Preview

Copilot AI Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appear to be two implementations of get_filter in the same class, which could lead to confusion or unintended behavior. Consider consolidating these definitions into a single implementation.

Suggested change
def get_filter(self, is_simple_search: bool):
"""Placeholder for subclasses, should be implemented there."""
raise NotImplementedError
# Removed redundant get_filter method from SumoSearch class.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It's an abstract method in SumoSearchInterface, so all child classes (including SumoSearch) must implement it with the same signature

  • Even though SumoSearch.get_filter() just raises NotImplementedError, it needs to maintain the correct signature for consistency and to ensure proper type checking

@smithellis smithellis changed the title Allow advanced search to return archvied questions Allow advanced search to return archived questions Apr 15, 2025
@smithellis smithellis requested a review from escattone April 23, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant